Optimal. Leaf size=91 \[ \frac {x^3}{6}-\frac {\sqrt {\pi } \cos (2 a) S\left (\frac {2 \sqrt {b} x}{\sqrt {\pi }}\right )}{16 b^{3/2}}-\frac {\sqrt {\pi } \text {FresnelC}\left (\frac {2 \sqrt {b} x}{\sqrt {\pi }}\right ) \sin (2 a)}{16 b^{3/2}}+\frac {x \sin \left (2 a+2 b x^2\right )}{8 b} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.07, antiderivative size = 91, normalized size of antiderivative = 1.00, number of steps
used = 6, number of rules used = 5, integrand size = 14, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.357, Rules used = {3485, 3467,
3434, 3433, 3432} \begin {gather*} -\frac {\sqrt {\pi } \sin (2 a) \text {FresnelC}\left (\frac {2 \sqrt {b} x}{\sqrt {\pi }}\right )}{16 b^{3/2}}-\frac {\sqrt {\pi } \cos (2 a) S\left (\frac {2 \sqrt {b} x}{\sqrt {\pi }}\right )}{16 b^{3/2}}+\frac {x \sin \left (2 a+2 b x^2\right )}{8 b}+\frac {x^3}{6} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 3432
Rule 3433
Rule 3434
Rule 3467
Rule 3485
Rubi steps
\begin {align*} \int x^2 \cos ^2\left (a+b x^2\right ) \, dx &=\int \left (\frac {x^2}{2}+\frac {1}{2} x^2 \cos \left (2 a+2 b x^2\right )\right ) \, dx\\ &=\frac {x^3}{6}+\frac {1}{2} \int x^2 \cos \left (2 a+2 b x^2\right ) \, dx\\ &=\frac {x^3}{6}+\frac {x \sin \left (2 a+2 b x^2\right )}{8 b}-\frac {\int \sin \left (2 a+2 b x^2\right ) \, dx}{8 b}\\ &=\frac {x^3}{6}+\frac {x \sin \left (2 a+2 b x^2\right )}{8 b}-\frac {\cos (2 a) \int \sin \left (2 b x^2\right ) \, dx}{8 b}-\frac {\sin (2 a) \int \cos \left (2 b x^2\right ) \, dx}{8 b}\\ &=\frac {x^3}{6}-\frac {\sqrt {\pi } \cos (2 a) S\left (\frac {2 \sqrt {b} x}{\sqrt {\pi }}\right )}{16 b^{3/2}}-\frac {\sqrt {\pi } C\left (\frac {2 \sqrt {b} x}{\sqrt {\pi }}\right ) \sin (2 a)}{16 b^{3/2}}+\frac {x \sin \left (2 a+2 b x^2\right )}{8 b}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.11, size = 87, normalized size = 0.96 \begin {gather*} \frac {-3 \sqrt {\pi } \cos (2 a) S\left (\frac {2 \sqrt {b} x}{\sqrt {\pi }}\right )-3 \sqrt {\pi } \text {FresnelC}\left (\frac {2 \sqrt {b} x}{\sqrt {\pi }}\right ) \sin (2 a)+2 \sqrt {b} x \left (4 b x^2+3 \sin \left (2 \left (a+b x^2\right )\right )\right )}{48 b^{3/2}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.12, size = 63, normalized size = 0.69
method | result | size |
default | \(\frac {x^{3}}{6}+\frac {x \sin \left (2 b \,x^{2}+2 a \right )}{8 b}-\frac {\sqrt {\pi }\, \left (\cos \left (2 a \right ) \mathrm {S}\left (\frac {2 x \sqrt {b}}{\sqrt {\pi }}\right )+\sin \left (2 a \right ) \FresnelC \left (\frac {2 x \sqrt {b}}{\sqrt {\pi }}\right )\right )}{16 b^{\frac {3}{2}}}\) | \(63\) |
risch | \(\frac {x^{3}}{6}-\frac {i {\mathrm e}^{-2 i a} \sqrt {\pi }\, \sqrt {2}\, \erf \left (\sqrt {2}\, \sqrt {i b}\, x \right )}{64 b \sqrt {i b}}+\frac {i {\mathrm e}^{2 i a} \sqrt {\pi }\, \erf \left (\sqrt {-2 i b}\, x \right )}{32 b \sqrt {-2 i b}}+\frac {x \sin \left (2 b \,x^{2}+2 a \right )}{8 b}\) | \(88\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [C] Result contains complex when optimal does not.
time = 0.52, size = 90, normalized size = 0.99 \begin {gather*} \frac {64 \, b^{3} x^{3} + 48 \, b^{2} x \sin \left (2 \, b x^{2} + 2 \, a\right ) - 3 \cdot 4^{\frac {1}{4}} \sqrt {2} \sqrt {\pi } {\left ({\left (\left (i + 1\right ) \, \cos \left (2 \, a\right ) - \left (i - 1\right ) \, \sin \left (2 \, a\right )\right )} \operatorname {erf}\left (\sqrt {2 i \, b} x\right ) + {\left (-\left (i - 1\right ) \, \cos \left (2 \, a\right ) + \left (i + 1\right ) \, \sin \left (2 \, a\right )\right )} \operatorname {erf}\left (\sqrt {-2 i \, b} x\right )\right )} b^{\frac {3}{2}}}{384 \, b^{3}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.39, size = 84, normalized size = 0.92 \begin {gather*} \frac {8 \, b^{2} x^{3} + 12 \, b x \cos \left (b x^{2} + a\right ) \sin \left (b x^{2} + a\right ) - 3 \, \pi \sqrt {\frac {b}{\pi }} \cos \left (2 \, a\right ) \operatorname {S}\left (2 \, x \sqrt {\frac {b}{\pi }}\right ) - 3 \, \pi \sqrt {\frac {b}{\pi }} \operatorname {C}\left (2 \, x \sqrt {\frac {b}{\pi }}\right ) \sin \left (2 \, a\right )}{48 \, b^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 201 vs.
\(2 (85) = 170\).
time = 1.61, size = 201, normalized size = 2.21 \begin {gather*} \frac {b^{\frac {3}{2}} x^{5} \sqrt {\frac {1}{b}} \sin {\left (2 a \right )} \Gamma \left (\frac {3}{4}\right ) \Gamma \left (\frac {5}{4}\right ) {{}_{2}F_{3}\left (\begin {matrix} \frac {3}{4}, \frac {5}{4} \\ \frac {3}{2}, \frac {7}{4}, \frac {9}{4} \end {matrix}\middle | {- b^{2} x^{4}} \right )}}{8 \Gamma \left (\frac {7}{4}\right ) \Gamma \left (\frac {9}{4}\right )} - \frac {\sqrt {b} x^{3} \sqrt {\frac {1}{b}} \cos {\left (2 a \right )} \Gamma \left (\frac {1}{4}\right ) \Gamma \left (\frac {3}{4}\right ) {{}_{2}F_{3}\left (\begin {matrix} \frac {1}{4}, \frac {3}{4} \\ \frac {1}{2}, \frac {5}{4}, \frac {7}{4} \end {matrix}\middle | {- b^{2} x^{4}} \right )}}{16 \Gamma \left (\frac {5}{4}\right ) \Gamma \left (\frac {7}{4}\right )} + \frac {x^{3}}{6} - \frac {\sqrt {\pi } x^{2} \sqrt {\frac {1}{b}} \sin {\left (2 a \right )} S\left (\frac {2 \sqrt {b} x}{\sqrt {\pi }}\right )}{4} + \frac {\sqrt {\pi } x^{2} \sqrt {\frac {1}{b}} \cos {\left (2 a \right )} C\left (\frac {2 \sqrt {b} x}{\sqrt {\pi }}\right )}{4} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [C] Result contains complex when optimal does not.
time = 0.49, size = 118, normalized size = 1.30 \begin {gather*} \frac {1}{6} \, x^{3} - \frac {i \, x e^{\left (2 i \, b x^{2} + 2 i \, a\right )}}{16 \, b} + \frac {i \, x e^{\left (-2 i \, b x^{2} - 2 i \, a\right )}}{16 \, b} - \frac {i \, \sqrt {\pi } \operatorname {erf}\left (-\sqrt {b} x {\left (-\frac {i \, b}{{\left | b \right |}} + 1\right )}\right ) e^{\left (2 i \, a\right )}}{32 \, b^{\frac {3}{2}} {\left (-\frac {i \, b}{{\left | b \right |}} + 1\right )}} + \frac {i \, \sqrt {\pi } \operatorname {erf}\left (-\sqrt {b} x {\left (\frac {i \, b}{{\left | b \right |}} + 1\right )}\right ) e^{\left (-2 i \, a\right )}}{32 \, b^{\frac {3}{2}} {\left (\frac {i \, b}{{\left | b \right |}} + 1\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int x^2\,{\cos \left (b\,x^2+a\right )}^2 \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________